//
//  SDFunctionDefine.h
//  SKinDiary
//
//  Created by pcyang on 16/6/26.
//  Copyright © 2016年 tencent. All rights reserved.
//

#ifndef SDFunctionDefine_h
#define SDFunctionDefine_h

//sigleton
#undef	DEF_SINGLETON
#define DEF_SINGLETON \
+ (instancetype)sharedInstance;

#undef	IMP_SINGLETON
#define IMP_SINGLETON \
+ (instancetype)sharedInstance \
{ \
static dispatch_once_t once; \
static id __singleton__; \
dispatch_once( &once, ^{ __singleton__ = [[self alloc] init]; } ); \
return __singleton__; \
}


#define QLLogDebug(a,b) ;

#define TT_RELEASE_SAFELY(__POINTER) { [__POINTER release]; __POINTER = nil; }



//check null string
#define CHECK_VALID_STRING(__aString)               (__aString && [__aString isKindOfClass:[NSString class]] && [__aString length])
#define CHECK_VALID_NUMBER(__aNumber)               (__aNumber && [__aNumber isKindOfClass:[NSNumber class]])
#define CHECK_VALID_ARRAY(__aArray)                 (__aArray && [__aArray isKindOfClass:[NSArray class]] && [__aArray count])
#define CHECK_VALID_DICTIONARY(__aDictionary)       (__aDictionary && [__aDictionary isKindOfClass:[NSDictionary class]] && [__aDictionary count])

#define VALID_STRING(__aString)                     (CHECK_VALID_STRING(__aString)?__aString:@"")

#endif /* SDFunctionDefine_h */
